<?php

namespace app\common\model\dts\approve\daily;

use think\Model;


class Let extends Model
{

    

    

    // 表名
    protected $name = 'dts_approve_daily_let';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'status_text'
    ];
    
    const status_0 = 0;
    const status_1 = 1;
    const status_2 = 2;
    const status_3 = 3;
    const status_4 = 4;
    const status_5 = 5;
    const status_6 = 6;
    const status_7 = 7;
    
    public function getStatusList()
    {
        return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '6' => __('Status 6')];
    }


    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
